Repository navigation
Conversation
-32042 now carries data.requestState, a signed token bound to the request and the suspended call. A host echoing it (_meta["mcpx/requestState"] or requestState) resumes the original call instead of Begin-ing a second upstream invocation; a retry before completion gets -32042 again with a fresh token. mcpx's own client echoes the token on its single retry. Retries without a token keep the old behaviour.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28b20d3259
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // below (#1556 Codex review). | ||
| if retry, rerr := c.urlElicitationRetry(ctx, name, err); retry { | ||
| raw, err = c.callToolAsLegacyTask(ctx, name, args) | ||
| raw, err = c.callToolAsLegacyTask(ctx, name, args, requestStateOf(err)) |
There was a problem hiding this comment.
Preserve the task relay token across the correlated retry
For a legacy task-required tool that returns -32042 with a requestState, callers requesting progress can lose notifications after the retry. The first callToolAsLegacyTask invocation unregisters its relay through defer done(), and this second invocation registers a newly generated progress token. Since the retry now resumes the original operation rather than starting another one, progress emitted against the original token is rejected by acceptProgress in relay.go. Keep the relay registration and progress token alive across the bounded retry, as the plain-call path does.
Useful? React with 👍 / 👎.
Fixes #2897.
Problem
urlRequiredResponseemitted-32042with onlydata.elicitations; a host retry carried no token, sobeginAskcalledAsk.Beginand ran the upstream operation a second time while the original suspended call was still alive.Change
-32042datanow carriesrequestState: the existing signed token (bound to method + param digest, expiring) naming the suspended call. Both emit sites (entry trigger and in-loopErrNoPushtrigger) mint it.resumeOfalso reads the token from_meta["mcpx/requestState"], because a 2025-11-25 request schema rejects a top-levelrequestState. The 2026requestStatefield still works.Behaviour
-32042again with a fresh token. No duplicate execution.Tests
TestURLRequiredWhenNoChannelToAskOn: exactly-once across an early retry and a post-completion retry (began == 1).TestURLElicitationRetryCarriesRequestState: client echoes the token.-race -shuffle=on -count=5on the changed tests.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.